﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using CMP.ERP.DAL;
using CMP.ERP.Model;
using System.Data;

namespace CMP.ERP.BLL
{
    public class PorBuyBLL
    {
        /// <summary>
        /// 实例化对象
        /// </summary>
        PorBuyDAL dal = new PorBuyDAL();
        /// <summary>
        /// 显示采购订单信息
        /// </summary>
        /// <returns></returns>
        public List<PorBuy> Porshow()
        {
            return dal.Porshow();
        }
        /// <summary>
        /// 根据年月日
        /// </summary>
        /// <param name="Year"></param>
        /// <param name="Month"></param>
        /// <param name="Day"></param>
        /// <returns></returns>
        public DataTable SelPorBuy(string StartTime, string End_Time)
        {
            return dal.SelPorBuy(StartTime, End_Time);
        }
        /// <summary>
        /// 添加采购订单信息
        /// </summary>
        /// <param name="model"></param>
        /// <param name="list"></param>
        public List<int> Add(PorBuy model, List<PorBuyMate> list)
        {
            return dal.Add(model, list);
        }
        /// <summary>
        /// 删除采购订单
        /// </summary>
        /// <param name="Pid"></param>
        /// <returns></returns>
        public List<int> del(int Pid)
        {
            return dal.del(Pid);
        }
        /// <summary>
        /// 根据采购id编号获取采购详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public DataTable ShowXiangqing2(int id)
        {

            return dal.ShowXiangqing2(id);
        }
        public DataTable ShowXiangqing1(int id)
        {
            return dal.ShowXiangqing1(id);
        }
        /// <summary>
        /// 入库
        /// </summary>
        /// <param name="Commodity_Id"></param>
        /// <param name="WareHose_Id"></param>
        /// <param name="Pid"></param>
        /// <returns></returns>
        public int IntoStock(int Commodity_Id, int WareHose_Id, string Commodity_Name, string WareHose_Name, int PorMaid)
        {
            return dal.IntoStock(Commodity_Id, WareHose_Id,Commodity_Name,WareHose_Name,PorMaid);
        }
        /// <summary>
        /// 审核入库
        /// </summary>
        /// <param name="StockOrderID"></param>
        /// <param name="listPurchaseOrderSheetInfo"></param>
        /// <returns></returns>
        public List<int> Update(int Pid, List<PorBuyMate> listpor)
        {
            return dal.Update(Pid, listpor);
        }
        /// <summary>
        /// 获取信息
        /// </summary>
        /// <param name="PorMaid"></param>
        /// <returns></returns>
        public List<PorBuyMate> huoquiry(int PorMaid)
        {
            return dal.huoquiry(PorMaid);
        }
        /// <summary>
        /// 查询某天总交易额
        /// </summary>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <returns></returns>
        public List<PorBuy> tian(string start,string end)
        {
            return dal.tian(start,end);
        }
        /// <summary>
        /// 查询某月总交易额
        /// </summary>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <returns></returns>
        public List<PorBuy> yue(string start,string end)
        {
            return dal.yue(start,end);
        }

        /// <summary>
        /// 查询某年总交易额
        /// </summary>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <returns></returns>
        public List<PorBuy> nian(string start,string end)
        {
            return dal.nian(start,end);
        }
    }
}
